package com.mall.user.converter;

import com.mall.user.dal.entitys.Member;
import com.mall.user.dto.QueryMemberResponse;
import com.mall.user.dto.UpdateMemberRequest;
import com.mall.user.dto.UserRegisterRequest;
import org.apache.ibatis.annotations.Insert;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import javax.xml.transform.Source;

/**
 *  ciggar
 * create-date: 2019/7/31-上午12:05
 */
@Mapper(componentModel = "spring")
public interface MemberConverter {
    @Mappings({
            @Mapping(source="userName",target = "username"),
            @Mapping(source="userPwd",target = "password"),
    })
    Member register2Member(UserRegisterRequest request);

    @Mappings({})
    QueryMemberResponse member2Res(Member member);

    @Mappings({})
    Member updateReq2Member(UpdateMemberRequest request);
}
